<template>
  <div class="row">
    <div class="index shadow-sm col-12">
      <div class="d-flex">
        <div class="col">
          <div
            style="
              padding: 20px 10px;
              border-width: 0 0 2px 0;
              border-color: #eeeeee;
              border-style: solid;
            "
            class="row no-gutters"
          >
            <div id="span">
              <strong>&nbsp;&nbsp;{{ title }} </strong>
              <span id="back" @click="back()">
                <i class="el-icon-right"></i> 返回</span
              >
            </div>
          </div>
        </div>
      </div>

      <slot name="main">
        <el-empty
          style="display: inline-block"
          :image-size="200"
          :image="require(`bodyLeftDefaultImage`)"
        ></el-empty>
      </slot>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return {
      backRoute:'',
    }
  },
  props: {
    title: {
      default: "未传入标题",
    },
  },
  watch: {
    $route(to, from) {
      this.backRoute = from
    },
  },
  methods: {
    back(to,from) {
      console.log(this.backRoute);
      this.$router.back();
    },
  },
};
</script>

<style scoped>
.row {
  height: 100%;
  padding: 0 15px;
}
.index {
  background-color: white;
}
#span {
  border-width: 0 0 0 7px;
  border-color: skyblue;
  border-style: solid;
}
#back {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.6);
  transition: all 0.2s;
}
#back:hover {
  color: rgba(0, 0, 0, 0.275);
  cursor: pointer;
  transition: all 0.2s;
}
strong {
  font-size: 1.25rem;
}
</style>